﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace Maestro_Proveedores.clases.herramientas
{
    class Enums
    {

        ArrayList valoresK;

        public Enums()
        {
            this.valoresK = new ArrayList();
            generarValores();
        }

        public void generarValores()
        {
            valoresK.Add(new valorNormal(0.8, 0.841621233572914));
            valoresK.Add(new valorNormal(0.81, 0.877896295051228));
            valoresK.Add(new valorNormal(0.82, 0.915365087842814));
            valoresK.Add(new valorNormal(0.83, 0.954165253146195));
            valoresK.Add(new valorNormal(0.84, 0.994457883209753));
            valoresK.Add(new valorNormal(0.85, 1.03643338949379));
            valoresK.Add(new valorNormal(0.86, 1.08031934081496));
            valoresK.Add(new valorNormal(0.87, 1.1263911290388));
            valoresK.Add(new valorNormal(0.88, 1.174986792));
            valoresK.Add(new valorNormal(0.89, 1.22652812));
            valoresK.Add(new valorNormal(0.9, 1.281551566));
            valoresK.Add(new valorNormal(0.91, 1.340755034));
            valoresK.Add(new valorNormal(0.92, 1.40507156));
            valoresK.Add(new valorNormal(0.93, 1.475791028));
            valoresK.Add(new valorNormal(0.94, 1.554773595));
            valoresK.Add(new valorNormal(0.95, 1.644853627));
            valoresK.Add(new valorNormal(0.96, 1.750686071));
            valoresK.Add(new valorNormal(0.97, 1.880793608));
            valoresK.Add(new valorNormal(0.98, 2.053748911));
            valoresK.Add(new valorNormal(0.99, 2.326347874));

        }

        public double retornarK(double parNivelServicio)
        {
            double valorK = 0;

            foreach (valorNormal val in valoresK)
            {

                if (val.nivelServicio == parNivelServicio)
                {
                    valorK = val.K;
                    break;
                }
            }

            return valorK;
        }

    }


    public class valorNormal
    {
        public valorNormal(double nivelServ, double k)
        {
            this.K = k;
            this.nivelServicio = nivelServ;
        }

        public double K;
        public double nivelServicio;
    }
}
